import json

number = 'LSCK00000726390'
# number_dic = {'number': number}  # 内层字典单独定义
# number_str = json.dumps(number_dic)  # 将json格式的数据转为字符

# 嵌套修改json

accountId = 11902  # 账户名
# accountId_dic = {'accountId': accountId}  # 内层字典单独定义
# accountId_str = json.dumps(accountId_dic)  # 将json格式的数据转为字符

id = 17050534866660885801



data_retail_add = {
    "info": "{\"organId\":142861,\"operTime\":\"2024-01-14 01:38:44\",\"number\":\"LSCK00000727282\",\"payType\":\"现付\",\"changeAmount\":\"500.00\",\"getAmount\":\"500.00\",\"backAmount\":0,\"accountId\":11902,\"type\":\"出库\",\"subType\":\"零售\",\"defaultNumber\":\"LSCK00000727282\",\"totalPrice\":500,\"fileName\":\"\",\"status\":\"0\"}",
    "rows": "[{\"id\":\"17051675241790659474\",\"name\":\"眼影\",\"standard\":null,\"model\":null,\"color\":null,\"materialOther\":\"\",\"stock\":90,\"unit\":\"盒\",\"snList\":\"\",\"batchNumber\":\"\",\"expirationDate\":\"\",\"sku\":\"\",\"operNumber\":\"5\",\"unitPrice\":100,\"allPrice\":500,\"remark\":\"\",\"orderNum\":1,\"depotId\":\"19957\",\"barCode\":\"1001\"}]"
}
info_dict = {"organId ":142861, "operTime ": "2024-01-14 01:38:44 ", "number ": number, "payType ": "现付 ", "changeAmount ": "500.00 ", "getAmount ": "500.00 ", "backAmount ":0, "accountId ":11902, "type ": "出库 ", "subType ": "零售 ", "defaultNumber ": number, "totalPrice ":500, "fileName ": " ", "status ": "0 "}
info_str = json.dumps(info_dict)
null = ' '
rows_dict = [{ "id ": id, "name ": "眼影 ", "standard ":null, "model ":null, "color ":null, "materialOther ": " ", "stock ":90, "unit ": "盒 ", "snList ": " ", "batchNumber ": " ", "expirationDate ": " ", "sku ": " ", "operNumber ": "5 ", "unitPrice ":100, "allPrice ":500, "remark ": " ", "orderNum ":1, "depotId ": "19957 ", "barCode ": "1001 "}]
rows_str = json.dumps(rows_dict)

data = {
    "info":info_str,
}

print(data)
data = {
    "rows": rows_str
}
print(data)
# 更改数据---失败